package com.magenta.maxoptra.gis;

import java.util.List;

/**
 * @author Sergey Grachev
 */
public interface AuxiliaryCacheService {

    /**
     * Find route by postal codes
     *
     * @param from            postal code of start of route
     * @param to              postal code of end of route
     * @param findCoordinates find coordinate of postal codes
     * @return route information or null
     */
    GeoRoute approximatePostalCodesRoute(PostalCode from, PostalCode to, boolean findCoordinates);

    /**
     * Find route by coordinates
     *
     * @param country country of coordinates
     * @param from    start route point
     * @param to      end route point
     * @return route information or null
     */
    GeoRoute approximateCoordinatesRoute(GeoCountry country, GeographicCoordinates from, GeographicCoordinates to);

    /**
     * Build full distance matrix for given postcodes
     *
     * @param postalCodes list of postcodes for matrix
     * @return all found distances
     */
    PostalCodeDistanceMatrix postalCodesDistanceMatrix(List<PostalCode> postalCodes);

    /**
     * Build full time-distance matrix for given coordinates
     *
     * @param coordinates list of points for matrix
     * @return all found distances and times
     */
    GeoRoute[][] timeDistanceMatrix(List<GeographicCoordinates> coordinates);
}
